﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Messages.aspx.cs" Inherits="Business_Messages" Theme="normal"%>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>系统短信表</title>
    <script language="javascript" src="../../../js/Basic/BasicPage.js" type="text/jscript"></script>
    <style type="text/css">
       .buttons
       {
         border:1px solid #C9DEEC; 
         background-color:#FFFFFF; 
         margin-left:0px;
         height:20px;
       } 
       .test
        {
        	
	        height:25px;
	        float:left;
	        padding-left: 65px;
	        padding-top: 5px;
	        color:#2f2f2f;
	        vertical-align: middle;
        }
    </style>
</head>
<body style="background-color:#fcf6ec">
    <form id="form1" runat="server">
    <asp:ScriptManager ID="Scriptmanager1" runat="server" EnableScriptGlobalization="true"
        EnableScriptLocalization="true">
    </asp:ScriptManager>
        <div class="normalnav">
            <div class="normalcontent">
                <span style="color:#ffffff">预约信息>>></span><span style="color:#f6ff00">短信发送历史记录</span></div>
        </div>
        
        <!-- 操作按钮 -->
        <div class="normalmenu1" style="z-index:100; position:absolute;">
            <div class="normalmenucontent" style="padding-left:10px;">
                 <div style="float:left; ">
                    <asp:Button ID="btn_Today" runat="server" Text=" 今天 " ToolTip="显示今天 00:00 ~ 23:59 的短信记录"
                        CssClass="buttons" CausesValidation="false" OnClick="btn_Today_Click" />
                    <asp:Button ID="btn_ThisWeekend" runat="server" Text=" 本周 " ToolTip="显示一周(周日 ~ 周六)的短信记录"
                        CssClass="buttons" CausesValidation="false" OnClick="btn_ThisWeekend_Click" />
                    <asp:Button ID="btn_ThisMonth" runat="server" Text=" 本月 " ToolTip="显示本月的订餐记录"
                        CssClass="buttons" CausesValidation="false" OnClick="btn_ThisMonth_Click" />    
                    <br />    
                    <asp:Button ID="btn_LastDay" runat="server" Text=" 昨天 " ToolTip="显示前一天 00:00 ~ 23:59 的短信记录"
                        CssClass="buttons" CausesValidation="false" OnClick="btn_LastDay_Click" /> 
                    <asp:Button ID="btn_LastWeekend" runat="server" Text=" 上周 " ToolTip="显示上周的短信记录"
                        CssClass="buttons" CausesValidation="false" OnClick="btn_LastWeekend_Click" />
                
                    <asp:Button ID="btn_LastMonth" runat="server" Text=" 上月 " ToolTip="显示上月的短信记录"
                        CssClass="buttons" CausesValidation="false" OnClick="btn_LastMonth_Click" />
                    <asp:Button ID="btn_All" runat="server" Text=" 全部 " ToolTip="显示所有的短信记录"
                        CssClass="buttons" CausesValidation="false" OnClick="btn_All_Click" />       
               </div>     
                <div style=" margin-left:-100px; padding-left:350px;">
                    <div style="line-height:20px;">
                    <asp:TextBox ID="txtDateA" Width="70px" runat="server" ToolTip="正确的日期格式为:YYYY-MM-DD"></asp:TextBox>
                    <asp:ImageButton runat="Server" ID="Image1" ImageUrl="~/Images/Calendar_scheduleHS.png" 
                        CausesValidation="false" AlternateText="点击选择日期"/>
                    <ajaxToolkit:CalendarExtender ID="customCalendarExtender" runat="server" TargetControlID="txtDateA"
                        Format="yyyy-MM-dd" PopupButtonID="Image1"/>
                    <asp:DropDownList ID="ddl_StartHour" runat="server">
                    </asp:DropDownList>时
                    至：
                    <asp:TextBox ID="txtDateB" Width="70px" runat="server" ToolTip="正确的日期格式为:YYYY-MM-DD"></asp:TextBox>           
                    <asp:ImageButton runat="Server" ID="Image2" ImageUrl="~/Images/Calendar_scheduleHS.png" 
                        CausesValidation="false" AlternateText="点击选择日期" />
                    <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtDateB"
                        Format="yyyy-MM-dd" PopupButtonID="Image2" /> 
                    <asp:DropDownList ID="ddl_EndHour" runat="server">
                    </asp:DropDownList>时    
                    <span style="color: #426F98; font-family: 宋体; font-size: 12px">
                        <asp:Label ID="lbldate" runat="server" Text="正确的日期格式为:YYYY-MM-DD"></asp:Label>     
                    </span> 
                    </div>     
                    <%--<br />--%>
                     <!--验证-->
                    <div style="margin-top:3px;">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                        ErrorMessage="<span style='color:red; font-size:13px;'>请填写开始时间！</span>" ControlToValidate="txtDateA" Display="None"></asp:RequiredFieldValidator>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                        ErrorMessage="<span style='color:red; font-size:13px;'>请填写结束时间！</span>" ControlToValidate="txtDateB" Display="None"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
                             ErrorMessage="<span style='color:red; font-size:13px;'>开始日期格式不正确！</span>" ControlToValidate="txtDateA" Display="None" 
                             ValidationExpression="^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$"></asp:RegularExpressionValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"
                             ErrorMessage="<span style='color:red; font-size:13px;'>结束日期格式不正确！</span>" ControlToValidate="txtDateB" Display="None" 
                             ValidationExpression="^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$"></asp:RegularExpressionValidator>
                    <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server"
                        TargetControlID="RegularExpressionValidator1" >
                    </ajaxToolkit:ValidatorCalloutExtender>
                    <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server"
                        TargetControlID="RegularExpressionValidator2" >
                    </ajaxToolkit:ValidatorCalloutExtender>
                    <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server"
                        TargetControlID="RequiredFieldValidator2" >
                    </ajaxToolkit:ValidatorCalloutExtender>
                    <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender4" runat="server"
                        TargetControlID="RequiredFieldValidator3" >
                    </ajaxToolkit:ValidatorCalloutExtender>

                   <asp:Label ID="lbl_SendTimeValidator" runat="server" Text=""></asp:Label>
                    
                    <%--短信类型:--%>
                    <asp:DropDownList ID="ddl_QueryType" runat="server" Visible="false">
                        <asp:ListItem Text="全部" Value="全部"></asp:ListItem>
                        <asp:ListItem Text="订餐" Value="订餐"></asp:ListItem>
                        <asp:ListItem Text="取消订餐" Value="取消订餐"></asp:ListItem>
                        <asp:ListItem Text="投票" Value="投票"></asp:ListItem>
                        <asp:ListItem Text="意见" Value="意见"></asp:ListItem>
                        <asp:ListItem Text="菜品推送" Value="菜品推送"></asp:ListItem>
                        <asp:ListItem Text="今日菜谱" Value="今日菜谱"></asp:ListItem>
                        <asp:ListItem Text="食堂公告" Value="食堂公告"></asp:ListItem>
                        <asp:ListItem Text="订单通知" Value="订单通知"></asp:ListItem>
                        <asp:ListItem Text="系统回复" Value="系统回复"></asp:ListItem>
                    </asp:DropDownList>
                    选查询类型:
                    <asp:DropDownList ID="ddl_SendType" runat="server">
                        <asp:ListItem Text="发送人" Value="ShortMessageSend"></asp:ListItem>
                        <asp:ListItem Text="接收人" Value="ShortMessageRecive"></asp:ListItem>
                        <asp:ListItem Text="短信内容" Value="ShortMessageContent"></asp:ListItem>
                    </asp:DropDownList>
                    关键字:
                    <asp:TextBox ID="txtPropasal" runat="server" Font-Size="14px" Width="123px" MaxLength="20"></asp:TextBox>
                    <asp:ImageButton ID="ibtnsearch" runat="server" ImageUrl="../Images/Basic/chaxun.gif"
                        OnClick="butlookout_Click" ToolTip="注：为空则查询所有"/>查询
                    </div>
                    <%--请输入发送人姓名或手机号码:&nbsp;
                    <asp:TextBox ID="txtPropasal" runat="server" Font-Size="14px" Width="123px"></asp:TextBox>
                    <asp:ImageButton ID="ibtnsearch" runat="server" ImageUrl="../Images/Basic/chaxun.gif"
                        OnClick="butlookout_Click" />
                    &nbsp; &nbsp;
                    <span style="color: #426F98; font-family: 宋体; font-size: 12px">注：为空则查询所有</span>
                    &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;--%>
                </div>
            </div>
        </div>
        
        <!-- 数据展示 -->
        <div class="normalgrid1" style="z-index:1; position:absolute; width:100%; left:20px;">
           <%--<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" 
                OnDataBound="GridView1_DataBound" OnRowCommand="GridView1_RowCommand" EmptyDataText="暂无">--%>
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" OnPageIndexChanging="GridView1_PageIndexChanging" OnRowDataBound="GridView1_RowDataBound"
                OnDataBound="GridView1_DataBound" OnRowCommand="GridView1_RowCommand" EmptyDataText="暂无" Width="90%" SkinID="Normal">
            <Columns>
                        
                <asp:TemplateField Visible="False" HeaderText="编号">
                    <ItemTemplate>
                        <asp:Label ID="lbl_ShortMessageID" Text='<%# Eval("ShortMessageID") %>'  runat="server"/>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
                
                <asp:TemplateField  HeaderText="序号" Visible="false">
                    <ItemTemplate>
                        <asp:Label ID="lbl_No" Text=""  runat="server"/>
                    </ItemTemplate>
                    <HeaderStyle  HorizontalAlign="Center" Width="5%"/>
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="短信类型" >
                    <ItemTemplate>
                        <asp:Label ID="lbl_ShortMessageType" Text='<%# Eval("ShortMessageType") %>' runat="server"/>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Width="10%"/>
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="发送人" >
                    <ItemTemplate>
                        <asp:Label ID="lbl_ShortMessageSend" Text='<%# Eval("ShortMessageSend") %>' runat="server"/>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Width="20%"/>
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="接收人" >
                    <ItemTemplate>
                        <asp:Label ID="lbl_ShortMessageRecive" Text='<%# Eval("ShortMessageRecive") %>' runat="server"/>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Width="20%"/>
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="发送时间">
                    <ItemTemplate>
                        <asp:Label ID="lbl_ShortMessageSendTime" Text='<%# Eval("ShortMessageSendTime") %>' runat="server"/>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Width="25%"/>
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="操作">
                    <ItemTemplate>
                        <asp:LinkButton ID="lbtn_Eidt" runat="server" CausesValidation="false"
                            CommandArgument='<%# Eval("ShortMessageID") %>' CommandName="eidt">查看</asp:LinkButton>
                    </ItemTemplate>
                    <HeaderStyle  HorizontalAlign="Center" Width="5%"/>
                    <ItemStyle HorizontalAlign="Center" Width="5%"/>
                </asp:TemplateField>
                
            </Columns>
        </asp:GridView>
        </div>
        
        <!-- 分页 -->
        <div class="normalpager1">
            <asp:Label ID="lblNumbers" runat="server"></asp:Label>&nbsp;&nbsp;
            <asp:LinkButton ID="btnFirst" OnClick="PagerButtonClick" runat="server" CommandArgument="0"
                CausesValidation="False">最首页</asp:LinkButton>&nbsp;
            <asp:LinkButton ID="btnPrev" OnClick="PagerButtonClick" runat="server" CommandArgument="prev"
                CausesValidation="False">前一页</asp:LinkButton>&nbsp;
            <asp:Label ID="lblCurrentIndex" runat="server"></asp:Label>&nbsp;/&nbsp;
            <asp:Label ID="lblPageCount" runat="server"></asp:Label>
            <asp:LinkButton ID="btnNext" OnClick="PagerButtonClick" runat="server" CommandArgument="next"
                CausesValidation="False">后一页</asp:LinkButton>&nbsp;
            <asp:LinkButton ID="btnLast" OnClick="PagerButtonClick" runat="server" CommandArgument="last"
                CausesValidation="False">最后页</asp:LinkButton>
        </div>
        
    </form>
</body>
</html>
